
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
	"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">

<html xmlns="http://www.w3.org/1999/xhtml"
	xmlns:h="http://java.sun.com/jsf/html"
	xmlns:ui="http://java.sun.com/jsf/facelets">
	
<ui:composition template="/template.xhtml">

  <ui:define name="conteudo">
	<div class='body_tarefa'>
	  	<div class='lab_tarefa'>
			<h:head>
				<title>Carrinho de Compras</title>
			</h:head>
	  	</div>
	  	<div class='form_tarefa'>
			<h:form>
				<h:outputLabel value="Produto: " />
				<h:inputText value="#{carrinhoMB.produto}" styleClass="input-block-level" />
				<h:commandButton action="#{carrinhoMB.adiciona}" value="Adicionar no Carrinho" styleClass="btn btn-primary" />
				<hr />
				<h:outputLabel value="Produtos no carrinho:" />
				<h:dataTable value="#{carrinhoMB.produtos}" var="p" class="table table-bordered">
				<tbody>
					<tr>
						<td><h:column><h:outputText value="#{p}" /></h:column></td>
						<td><h:column><h:commandLink action="#{carrinhoMB.remove(p)}" value="Remover" class='btn btn-danger' /></h:column></td>
					</tr>
				</tbody>
				</h:dataTable>
			</h:form>
	  	</div>
	</div>
  </ui:define>
</ui:composition>
</html>